<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="chrome=1" >
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"  name="viewport" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name = "format-detection" content = "telephone=no">
	<meta name="x5-orientation" content="portrait">
	<title>Nan</title>
	<!--<link href="../Nan/css/index.css" rel="stylesheet" type="text/css">-->
	<script type="text/javascript" src="file:///android_asset/Nan/js/jquery.js"></script>
</head>

<body>

<div id="welcomePan" style="display:block;margin-top:50px;">
	<div style=" width:90%; margin: 0 auto; text-align:center">
		<!--<h1 style="color:#000; font-size:1.4em;">Hello~我叫楠楠</h1>-->
		<!--<img style="width:80px; margin:0 auto;" src="img/head.png" />-->
		<p style="color:#343434; font-size:1.2em">嘿,我是楠<br>使用我的综合搜索<br>比如:你可以对我直接说<br><strong>"搜索一下东北F4"</strong></p>
	</div>
</div>

<div id="ResultPan" style="display:none">
	<ul style="width:100%; padding:0; background:#f0f0f0; list-style:none;"></ul>
</div>

</body>

<script>
var welPan=document.getElementById('welcomePan');
var resPan=document.getElementById('ResultPan');
var wh=window.innerHeight;
var ww=window.innerWidth;
//setKey("%E7%BE%8E%E5%9B%BD%E9%98%9F%E9%95%BF")

function setResult(t,h){
	/*if($("#ResultPan").css('display')=="none"){
		$("#welcomePan").hide()
		$("#ResultPan").fadeIn(300,function(){
			htmlstr='<li data-href="'+h+'" style=" width:100%; padding:0; background:#fafafa; padding:10px 0; margin-top:10px; list-style:none;"><div style=" width:90%; margin:0 auto; color:#636363; font-size:1em">'+t+'</div></li>'
				$("#ResultPan>ul").append(htmlstr)
		})
	}*/
	if(resPan.style.display=="none"){
		welPan.style.display="none";
		resPan.style.display="block";
	}
	htmlstr='<li data-href="'+h+'" style=" width:100%; padding:0; background:#f3f3f3; padding:10px 0; margin-top:10px; list-style:none; border-radius:5px;"onclick="window.Nan.openNewActivity(this.attributes[0].value)">';
	htmlstr+='<div style=" width:90%; margin:0 auto; color:#333; font-size:1em; break-words:break-all;">'+t+'</div>';
	htmlstr+='</li>';
	resPan.innerHTML+=htmlstr;
}

function setKey(key){

    if(resPan.style.display=="none"){
		welPan.style.display="none";
		resPan.style.display="block";
	}
	u="http://fakepi.applinzi.com/?"+key

	htmlstr='<li style=" width:100%;  padding:15px 0; margin-top:30px; list-style:none; font-size:16px">';
	htmlstr+='<div style=" width:90%; margin:0 auto; color:#333; font-size:1.2em; break-words:break-all; text-align:center">正在加载中...</div>';
	htmlstr+='</li>';
	resPan.innerHTML=htmlstr;

    $.ajax({url:u,type: "GET",async:true,dataType: "json",cache:false,timeout:80000,
        success:function(json){
            resPan.innerHTML=""
        	for(i=0;i<json.length;i++){
        		htmlstr='<li data-href="'+json[i].link+'" style=" width:100%; background:#f3f3f3; padding:10px 0; margin-top:10px; list-style:none; border-radius:5px;"onclick="window.Nan.openNewActivity(this.attributes[0].value)">';
				htmlstr+='<div style=" width:90%; margin:0 auto; color:#333; font-weight:bold; font-size:1em; break-words:break-all; margin-bottom:5px;">'+json[i].title+'</div>';
				htmlstr+='<div style=" width:90%; margin:0 auto; color:#636363; font-size:.8em; break-words:break-all; margin-bottom:5px;">关联度:'+json[i].weight+'</div>';
				htmlstr+='<div style=" width:90%; margin:0 auto; color:#c6c6c6; font-size:.6em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">'+json[i].link+'</div>';
				htmlstr+='</li>';
				resPan.innerHTML+=htmlstr;
        	}
        },
        error:function(){
            htmlstr='<li style=" width:100%; padding:15px 0; margin-top:30px; list-style:none; font-size:16px ">';
			htmlstr+='<div style=" width:90%; margin:0 auto; color:#333; font-size:1.2em; break-words:break-all;text-align:center">网络开小差了...</div>';
			htmlstr+='</li>';
			resPan.innerHTML=htmlstr;
        }
    });

}

</script>
</html>
